﻿
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




$(function() {
 var app=menuAppPath;
 app=app.substr(0,app.length-1);
    var time;
    var i=0;
    $(".site_menu #imgLeft").mouseover(function() {
        i=0;
        $(".site_menu #imgLeft").attr("src", app+"/images/btn_menu_hover.gif");
        $(".site_menu #divRight").stop(true, true).show("");
    });
    $(".site_menu #imgLeft").mouseout(function () {
       autotime();
    });
   function autotime(){
        time=setTimeout(autotime,1000);
        i++;
        if(i>2){
            $(".site_menu #imgLeft").attr("src",app+ "/images/btn_menu.gif");
            $(".site_menu #divRight").stop(true, true).hide("");
            clearTimeout(time);
        }
   }
    $(".site_menu #divRight").mouseover(function() {
        clearTimeout(time);
        i=0;
        $(".site_menu #imgLeft").attr("src", app+"/images/btn_menu_hover.gif");
        $(".site_menu #divRight").stop(true, true).show("");
    });
    $(".site_menu #divRight").mouseout(function() {
        $(".site_menu #imgLeft").attr("src", app+"/images/btn_menu.gif");
        $(".site_menu #divRight").stop(true, true).hide("");
    });
    
     
});

 function addEvent(elem, type, fn) {
    if (elem.nodeName === "A" && type === "click") { elem.setAttribute("href", "javascript:void(0)") }; if (elem.addEventListener) { elem.addEventListener(type, fn, false); return true; } else if (elem.attachEvent) {
        elem['e' + type + fn] = fn; elem[type + fn] = function() { elem['e' + type + fn](window.event); }
        elem.attachEvent("on" + type, elem[type + fn]); return true;
    }
    return false;
};

function slide(o) {
    var handle = o.handle, content = o.content, mode = o.mode || "moseover", myClass = o.current, speed = o.speed, fn = o.fn, flag = 0, timer; for (var i = 0; i < handle.length; i++) { (function(i) { addEvent(handle[i], mode, function() { clearTimeout(timer); show(i); }); })(i); }
    function show(flag) { var i = flag ;for (var j = 0; j < handle.length; j++) { handle[j].className = ""; content[j].style.display = "none"; }; handle[i].className = myClass; content[i].style.display = "block"; if (handle[i].nodeName === "A") handle[i].blur(); (flag + 1) == handle.length ? flag = 0 : flag++; if (speed) { timer = setTimeout(function() { show(flag) }, speed); addEvent(content[i], "mouseover", function() { clearTimeout(timer) }); addEvent(content[i], "mouseout", function() { clearTimeout(timer); timer = setTimeout(function() { show(flag) }, speed) }); }; if (fn) fn();  }
    if (speed) show(flag);
}
//-->
